package dominion.kingdom;

import dominion.Card;
import dominion.CardTypes;
import dominion.Dominion;
import dominion.Player;
import dominion.Tresure;

public class Bureaucrat extends AbstractAttackAction {

	@Override
	public void execute(Dominion dominion) {
		Player player = dominion.current();
		player.putOnDeck(Tresure.SILVER, true);
		for (Player p : dominion.waitings()) {
			if (hasMoat(p) == false) {
				for (Card c : p.hand()) {
					if (CardTypes.isVictory(c)) {
						p.hand().remove(c);
						p.putOnDeck(c, false);
						break;
					}
				}
			}
		}
	}

	@Override
	public CardTypes getType() {
		return CardTypes.Bureaucrat;
	}

}
